package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.BaseEntity;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.addon.entity.RooEntity;

@Entity
@RooJavaBean
@RooToString
@RooEntity
public class Challenge extends BaseEntity {
	private static final long serialVersionUID = 1L;
    @ManyToOne
    private Event event;
    
    private String note;
    
    private Boolean accepted = true;

    public Team getChallengerTeam(){
    	return this.getEvent().getChallenger();
    }
    
    public Team getDefenderTeam(){
    	return this.getEvent().getDefender();
    }
}
